package com.wxb.pm.service;

import com.wxb.pm.Model.domain.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wxb.pm.Model.domain.User;
import com.wxb.pm.Model.dto.TeamQuery;
import com.wxb.pm.Model.requset.TeamJoinRequest;
import com.wxb.pm.Model.requset.TeamQuitRequest;
import com.wxb.pm.Model.requset.TeamUpdateRequest;
import com.wxb.pm.Model.vo.UserTeamVO;

import java.util.List;

/**
* @author 12796
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2023-07-23 16:34:26
*/
public interface TeamService extends IService<Team> {

    Long addTeam(Team team,User loginUser);


    /**
     * 查找全部队伍
     *
     * @param teamQuery
     * @param isAdmin
     * @return
     */

    List<UserTeamVO> findAllTeam(TeamQuery teamQuery,boolean isAdmin);

    /**
     * 修改队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param loginUser
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User loginUser);

    /**
     * 用户退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 队长解散队伍
     * @param id
     * @return
     */
    Boolean deleteTeam(Long id,User loginUser);
}
